<%@ page import="dao.DiaryDao" %>
<%@ page import="entity.DiaryInfo" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/10/13
  Time: 11:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>日记修改</title>
    <link rel="stylesheet" href="../css/bootstrap.css">
</head>
<body>
<%
    Integer id=Integer.valueOf(request.getParameter("id"));
    DiaryDao dd=new DiaryDao();
    DiaryInfo di=dd.findById(id);
    request.setAttribute("d",di);
%>
<form method="post" action="save">
    <table class="table table-bordered">
        <caption style="text-align: center">日记修改</caption>
        <tr>
            <td>
                ${d.diaryDay}
                <input type="hidden" value="${d.id}" name="id">
                <%--<input type="hidden" value="${d.diaryDay}" name="diaryDay">--%>
            </td>
            <td>
                ${d.weather}&nbsp;&nbsp;心情：${d.mood}
                    <%--<input type="hidden" value="${d.weather}" name="weather">--%>
                    <%--<input type="hidden" value="${d.mood}" name="mood">--%>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <textarea name="contents" style="width: 100%;height: 500px" >${d.contents}</textarea>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <button class="btn btn-primary">保存</button>
                <a href="diaryList" class="btn btn-primary">返回</a>
            </td>
        </tr>
    </table>
</form>
</body>
</html>
